import Vue from 'vue'
import VueRouter from 'vue-router'
import LayoutIndex from '@/views/Layout/index.vue'
import VideosIndex from '@/views/Videos/index.vue'
import UserIndex from '@/views/User/index.vue'
import LoginIndex from '@/views/Login/index.vue'
import HomeIndex from '@/views/Layout/home.vue'
import playVideo from '@/views/Videos/playVideo.vue'
import UserEditor from '@/views/User/editor.vue'
import VideoDetail from '@/views/Videos/videoDetail.vue'
Vue.use(VueRouter)

const router = new VueRouter({
  routes: [
    {
      path: '/',
      component: LayoutIndex,
      redirect: '/home',
      children: [
        { path: '/home', component: HomeIndex },
        { path: '/videos', component: VideosIndex },
        { path: '/user', component: UserIndex },
        { path: '/login', component: LoginIndex }
      ]
    },
    {
      path: '/playVideo/:id',
      component: playVideo
    },
    {
      path: '/editor',
      component: UserEditor
    },
    {
      path: '/videoDetail/:categoryId',
      component: VideoDetail
    }

  ]
})

export default router
